package com.yiwenup.exception.failure;

import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.boot.diagnostics.AbstractFailureAnalyzer;
import org.springframework.boot.diagnostics.FailureAnalysis;

/**
 * Bean缺失异常启动报错包装
 **/
public class NoSuchBeanDefinitionFailureAnalyzer extends AbstractFailureAnalyzer<NoSuchBeanDefinitionException> {
    @Override
    protected FailureAnalysis analyze(Throwable rootFailure, NoSuchBeanDefinitionException cause) {
        return new FailureAnalysis(cause.getMessage(), "Please Check Bean Configuration!", cause);
    }
}
